﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using TestMapService.MapService;

namespace TestMapService
{
    class Program
    {
        static void Main(string[] args)
        {
            var mapService = new MapService.MapServiceClient();


            var data = mapService.GetAddressLocation("罗湖区翠竹路富安娜前人行道", "深圳");
            Console.WriteLine(JsonConvert.SerializeObject(data));
            Console.WriteLine("----------------------");

            var data1 = mapService.GetDistance(new MapPointModel[]
            {
                new MapPointModel()
                {
                    Id = "1",
                    PointModel = new PointModel()
                    {
                         lat = 22.56313,
                    lng = 114.1373
                    }
                }, 
                new MapPointModel()
                {
                    Id = "2",
                    PointModel = new PointModel()
                    {
                        lat = 22.59888,
                    lng = 114.1258
                    }
                }, 
            }, new PointModel()
            {
                lat = 22.65222,
                lng = 114.1673
            });
            Console.WriteLine(JsonConvert.SerializeObject(data1));
            Console.WriteLine("----------------------");

            var data2 = mapService.GetDistnaceNearby(new MapPointModel[]
            {
                new MapPointModel()
                {
                    Id = "1",
                    PointModel = new PointModel()
                    {
                         lat = 22.56313,
                    lng = 114.1373
                    }
                }, 
                new MapPointModel()
                {
                    Id = "2",
                    PointModel = new PointModel()
                    {
                        lat = 22.59888,
                    lng = 114.1258
                    }
                }, 
            }, new PointModel()
            {
                lat = 22.65222,
                lng = 114.1673
            }, 1);
            Console.WriteLine(JsonConvert.SerializeObject(data2));
            Console.WriteLine("----------------------");

            Console.ReadKey();
        }
    }
}
